﻿using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using LTJ.Common;
using LTJ.FrameWork;

namespace uswinweb.admin
{
    /// <summary>
    /// 用户主菜单设置
    /// </summary>
    public partial class usermainmenu_set : AdminPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string menuid = SASRequest.GetString("menuid");
            string mode = SASRequest.GetString("mode");

            if (mode != "")
            {
                if (mode == "del")
                {
                    ManageMenu.DeleteUserMainMenu(int.Parse(menuid));
                    Caches.ResetUserMenuCache(LTJ.Entity.UserMenuType.MainMenu);
                }
                else
                {
                    if (menuid == "0")
                    {
                        ManageMenu.NewUserMainMenu(SASRequest.GetString("menutitle"), SASRequest.GetString("etitle"), SASRequest.GetString("defaulturl"));
                        Caches.ResetUserMenuCache(LTJ.Entity.UserMenuType.MainMenu);
                    }
                    else
                    {
                        ManageMenu.EditUserMainMenu(int.Parse(menuid), SASRequest.GetString("menutitle"), SASRequest.GetString("etitle"), SASRequest.GetString("defaulturl"));
                        Caches.ResetUserMenuCache(LTJ.Entity.UserMenuType.MainMenu);
                    }
                }
                Response.Redirect("usermainmenu_set.aspx", true);
            }
        }
    }
}